using System;
using System.Windows.Forms;
namespace Circus.CodeEditor
{
	public class KeyData 
	{
		private Keys keys;
		private KeyEvent action;
		private KeyEventEx actionEx;
		private object param;
		private int state;
		private int leaveState;
		public Keys Keys
		{
			get
			{
				return this.keys;
			}
			set
			{
				this.keys = value;
			}
		}
		public object Param
		{
			get
			{
				return this.param;
			}
			set
			{
				this.param = value;
			}
		}
		public int State
		{
			get
			{
				return this.state;
			}
			set
			{
				this.state = value;
			}
		}
		public int LeaveState
		{
			get
			{
				return this.leaveState;
			}
			set
			{
				this.leaveState = value;
			}
		}
		public KeyEvent Action
		{
			get
			{
				return this.action;
			}
			set
			{
				this.action = value;
			}
		}
		public KeyEventEx ActionEx
		{
			get
			{
				return this.actionEx;
			}
			set
			{
				this.actionEx = value;
			}
		}
		public string EventName
		{
			get
			{
				string result;
				if (this.Action != null)
				{
					result = this.Action.Method.Name;
				}
				else
				{
					if (this.ActionEx != null)
					{
						result = this.ActionEx.Method.Name;
					}
					else
					{
						result = string.Empty;
					}
				}
				return result;
			}
			set
			{
			}
		}
		public KeyData()
		{
		}
		public KeyData(Keys keys, KeyEvent action, KeyEventEx actionEx, object param, int state, int leaveState)
		{
			this.keys = keys;
			this.action = action;
			this.actionEx = actionEx;
			this.param = param;
			this.state = state;
			this.leaveState = leaveState;
		}
		public override string ToString()
		{
			string result;
			if (this.Action != null)
			{
				result = this.Action.Target.GetType().Name + "." + this.Action.Method.Name;
			}
			else
			{
				if (this.ActionEx != null)
				{
					result = string.Concat(new string[]
					{
						this.ActionEx.Target.GetType().Name,
						".",
						this.ActionEx.Method.Name,
						"(",
						this.Param.ToString(),
						")"
					});
				}
				else
				{
					result = base.ToString();
				}
			}
			return result;
		}
	}
}
